<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>Handsig</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css" />
		<link rel="stylesheet" type="text/css" href="../css/aui.css" />
		<style>
			html, body {
				height: 100%;
				background-color: transparent;
			}
			#mask {
				height: 100%;
				width: 100%;
			}
			#radio-list {
				-webkit-transition: all .3s;
				transition: all .3s;
				-webkit-transform: translateY(100%);
				display: -webkit-box;
				display: -webkit-flex;
				display: flex;
				-webkit-box-orient: vertical;
				-webkit-flex-flow: column;
				flex-flow: column;
				width: 80%;
				left: 10%;
				top: 25%;
				height: 75%;
				font-size: 16px;
				position: absolute;
			}
			#radio-list.in {
				-webkit-transform: translateY(0%);
			}
			#radio-list h2 {
				color: #272930;
				font-size: 16px;
				padding: 14px;
				background-color: #eaeaea;
			}
			#list .round {
				border-radius: 5px;
				padding-top: 5px;
				padding-bottom: 5px;
			}
			
			#list .aui-input-row:first-child:after {
				border-top: 0px solid #c8c7cc;
			}
			#list .aui-input-row:last-child:after {
				border-bottom: 0px solid #c8c7cc;
			}
			
		</style>
	</head>
	<body>
		<div id="mask">
			<div id="radio-list">
				<div class="aui-content list" id="list">
					<div class="aui-form round" id="menulist">
						<div class="aui-input-row">
							<label class="aui-input-addon">胡华成1</label>
							<input class="aui-pull-right aui-radio aui-radio-info" type="radio" name="demo">
						</div>
					</div>
					<script id="template" type="text/x-dot-template">
						{{for(var i=0;i<it.length;i++){}}
						<div class="aui-input-row " tapmode="" onclick="SendEvent({{=i}})">
						<label class="aui-input-addon">{{=it[i].name}}</label>
						<!--<input class="aui-pull-right aui-radio aui-radio-info" type="radio" name="demo">-->
						</div>
						{{}}}
					</script>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/zepto.js"></script>
	<script type="text/javascript" src="../script/doT.min.js"></script>
	-
	<script type="text/javascript">
		function Close() {
			var $list = $('#radio-list');
			$list.removeClass('in');
			setTimeout(function() {
				api.closeFrame();
			}, 200);
		}

		var kind = 1;
		var count = 0;
		var menus = [[], [{
			name : "删除签名数据",
			action : "Del"
		}, {
			name : "用作模板",
			action : "AsTemplate"
		}, {
			name : "详细情况",
			action : "Detail"
		}, {
			name : "显示",
			action : "Show"
		},
		//{name:"认证",action:"Del"}	,
		{
			name : "认证",
			action : "Verify"
		}, {
			name : "认证结果",
			action : "VerifyResult"
		}], [{
			name : "删除",
			action : "Del"
		}, {
			name : "取消模板",
			action : "CancelTemplate"
		}, {
			name : "用于模板",
			action : "UseTemplate"
		}, {
			name : "详细情况",
			action : "Detail"
		}, {
			name : "显示",
			action : "Show"
		},		
		{
			name : "训练",
			action : "Train"
		}, {
			name : "训练结果",
			action : "TrainResult"
		}]];
		function LoadMenuList() {
			var template = document.getElementById('template');
			var list_content = document.getElementById('menulist');
			var pagefn = doT.template(template.text);			
			list_content.innerHTML = pagefn(menus[kind]);
		}
		
		function SendEvent(idx) {
			var $list = $('#radio-list');
			$list.removeClass('in');
			api.sendEvent({
				name : "SignList",
				extra : {
					'action' : menus[kind][idx].action,
					'kind' : kind
				}
			}, function(ret, err) {
			});
			$list.removeClass('in');
			setTimeout(function() {
				api.closeFrame();
			}, 50);
		}

		apiready = function() {
			kind = api.pageParam.kind;
			//当前类型
			count = api.pageParam.count;
			//选择记录总数
			LoadMenuList();
			var $list = $('#radio-list');
			$list.addClass('in');
			$(document.body).on('touchend', function(evt) {
				if (!$.contains($list[0], evt.target)) {
					$list.removeClass('in');
					setTimeout(function() {
						api.closeFrame();
				}, 100);
				}
			});
		};
	</script>
</html>